package com.iflytek.sbd.demo.fanxing;

/**
 * @program: sbd
 * @description: 定义多元泛型类
 * @author: 陈英俊
 * @create: 2022-01-11 10:01
 */
public class Notepad<K, V> {

    private K key;

    private V value;

    public K getKey() {
        return key;
    }

    public void setKey(K key) {
        this.key = key;
    }

    public V getValue() {
        return value;
    }

    public void setValue(V value) {
        this.value = value;
    }


    public static void main(String[] args) {
        Notepad<String, Integer> notepad = new Notepad<>();
        notepad.setKey("陈亮");
        notepad.setValue(18);
//        notepad.setKey("1");会覆盖
//        notepad.setValue(1);
        System.out.println(notepad.getKey() + ".." + notepad.getValue());
    }
}
